﻿/*
* 这个测试文件是给队友看的
* 最后要删掉
*/

#include <iostream>
#include "collision.h"


// 使用示例
void cls_test1() {
    // 添加碰撞箱
    PointCollisionBox point1(1, 1);
    RectangleCollisionBox rect1(1, 1, 2, 3);
    CircleCollisionBox circle1(1, 1, 1);

    PointCollisionBox point2(2, 1);
    RectangleCollisionBox rect2(4, 4, 2, 3);
    CircleCollisionBox circle2(2, 2, 2);

    std::cout << CollisionBox::checkCollision(point1,point2) << "\n";
    std::cout << point1.checkCollision(rect1) << "\n";
    std::cout << point1.checkCollision(circle1) << "\n";
    
    std::cout << rect1.checkCollision(point2) << "\n";
    std::cout << rect1.checkCollision(rect2) << "\n";
    std::cout << rect1.checkCollision(circle2) << "\n";

    rect2.setX(3);
    std::cout << rect1.checkCollision(rect2) << "\n";

}

void cls_test2() {
    RectangleCollisionBox rect(1.5,0,1,1);
    CircleCollisionBox circle(1, 1, 1);
    std::cout << rect.checkCollision(circle) << "\n";
    circle.setRadius(0.4);
    std::cout << rect.checkCollision(circle) << "\n";

}

int main() {
    cls_test1();
    cls_test2();

    return 0;
}